import { createRouter, createWebHistory } from 'vue-router'

const routes = [

  {
    path: '/',
    component: () => import('@/views/user/login.vue')
  },
  {
    path: '/main',
    component: () => import('@/views/main.vue'),
    redirect: '/main/index',
    children: [{
      path: 'index',
      component: () => import('@/views/index.vue')
    }, {
      path: 'video_management',
      component: () => import('@/views/video/video_management.vue'),
    }, {
      path: 'user_option',
      redirect: '/main/user_option/user_message',
      component: () => import('@/views/user/user_option.vue'),
      children: [{
        path: 'user_message',
        component: () => import('@/views/user/user_message.vue'),
      }, {
        path: 'user_dynamic',
        component: () => import('@/views/user/user_dynamic.vue'),
      }]
    },{
      path: '/video',
      component: () => import('@/views/video/video.vue'),
      children:[]
    }
    ]
  }, {
    path: '/register',
    name: 'register',
    component: () => import('@/views/user/register.vue')
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
